#include <iostream>
using namespace std;
int n,k;
int count=0;
int path=0; 
void dfs(int pos,int begin)
{
	if(pos==k)
	{
		if(path==n)
		count++;
		return;
	}
    for(int i=begin;i<=n;i++)
	 {
	 	if(path+i*(k-pos)>n)return;
	 	path+=i;
	 	dfs(pos+1,i);
	 	path-=i;
	 	
	 }	
}
int main()
{
	cin>>n>>k;
	dfs(0,1);
	cout<<count;
	return 0;
}
